<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/admin_template.xhtml">

    <ui:define name="body">
    	<h:form>
    		<h:panelGroup id="mask_id">
	    		<rich:panel id="ap_id">
	    			<f:facet name="header"></f:facet>
		    		<h:commandButton value="#{messages.back_msg}" action="discount" immediate="true"/>
		    		<rich:spacer width="10" />
		    		<a:commandButton value="#{messages.save_msg}" action="#{kDiscountManager.saveKadrons()}" reRender="ap_id, messages"/>
		    		<br />
		    		<table>
		    			<tr>
		    				<td>
		    					<h:outputText value="#{messages.valid_from_msg}:" />
		    					<span class="m">*</span>
		    				</td>
		    				<td>
		    					<rich:calendar value="#{kDiscountManager.discount.validFrom}" required="true" showWeeksBar="false"/>
		    				</td>
		    			</tr>
		    			<tr>
		    				<td>
		    					<h:outputText value="#{messages.valid_to_msg}:" />
		    					<span class="m">*</span>
		    				</td>
		    				<td>
		    					<rich:calendar value="#{kDiscountManager.discount.validTo}" required="true" showWeeksBar="false"/>
		    				</td>
		    			</tr>
		    			<tr>
		    				<td>
		    					<h:outputText value="#{messages.active_msg}" />
		    				</td>
		    				<td>
		    					<h:selectBooleanCheckbox value="#{kDiscountManager.discount.active}" />
		    				</td>
		    			</tr>
		    			<tr>
		    				<td>
		    					<h:outputText value="#{messages.kadrons_msg}" />
		    					<span class="m">*</span>
		    				</td>
		    				<td>
		    					<h:inputText value="#{kDiscountManager.kadrons}" size="4" required="true" maxlength="4"/>
		    				</td>
		    			</tr>
		    			<tr>
		    				<td>
		    					<h:outputText value="#{messages.bonus_kadrons_msg}" />
		    					<span class="m">*</span>
		    				</td>
		    				<td>
		    					<h:inputText value="#{kDiscountManager.bonusKadrons}" size="4" required="true" maxlength="4"/>
		    				</td>
		    			</tr>
		    		</table>
		    		<br />
		    		<table>
		    			<tr>
		    				<td>
					    		<ui:include src="/pages/in/k_translate.xhtml" >
					    			<ui:param name="item" value="#{kDiscountManager.discount}" />
					    		</ui:include>
		    				</td>
		    			</tr>
		    		</table>
	    		</rich:panel>
    		</h:panelGroup>
    	</h:form>
    </ui:define>
</ui:composition>
